
<a name="Dia"><h2>Dia: Easy as 1, 2, 3</h2></a>
<p>
Dia is an open source tool, currently has special objects to help draw entity relationship diagrams, UML diagrams, flowcharts, network diagrams, and simple circuits. It is also possible to add support for new shapes by writing simple XML files, using a subset of SVG to draw the shape.
<br />
It can load and save diagrams to a custom XML format (gzipped by default, to save space), can export diagrams to EPS or SVG formats and can print diagrams (including ones that span multiple pages).
</p>
<h5>1. Set up</h5>
<p>
In Ubuntu, you can install Dia by
<br />
sudo apt-get install dia
In other Unix-based, you may have to install <a href="ftp://ftp.gtk.org/pub/gtk/v1.2/">gtk+</a> first. Then install <a href="ftp://ftp.gnome.org/pub/GNOME/stable/sources/imlib/">glib</a> and <a href="http://library.gnome.org/misc/release-notes/2.30/#rninstallation">gnome.</a><br />
</p>
<h5>2. Basics</h5>
<p>
Drawing a diagram generally is drawing text box, text and arrows with different kinds of hierarchy. Dia has enough tools for you to fulfill the task.
</p>

<img style="float:left; margin: 20px;" src="http://projects.gnome.org/dia/diatut/basics/mainwin.png" />
<img style="float:left; margin: 20px;" src="http://projects.gnome.org/dia/diatut/basics/org5.png" />
<p style="clear:left;">
To draw a diagram as the right image:
<br />
- Draw some text boxes
<br />
- Create some text blocks
<br />
- Align text to corresponding text box (disable align-to-grid by key 'g')
<br />
- Lock the text to text box
<br />
- Draw relationship lines. If you want to change the way line goes, break it into segments by 'add a segment'.
</p>

<h5>3. Advanced</h5>
<p>
To learn more about Dia, vitsit its website: <a href="http://projects.gnome.org/dia/">http://projects.gnome.org/dia/</a>
</p>

<br />

<br />
<a name="gdb"><h2>GDB: The GNU Debugger</h2></a>
<p>
GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it executes -- or what another program was doing at the moment it crashed.
<br />
GDB can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act:
<ul>
<li>Start your program, specifying anything that might affect its behavior.</li>
<li>Make your program stop on specified conditions.</li>
<li>Examine what has happened, when your program has stopped.</li>
<li>Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another.</li>
</ul>
The program being debugged can be written in Ada, C, C++, Objective-C, Pascal (and many other languages). Those programs might be executing on the same machine as GDB (native) or on another machine (remote). GDB can run on most popular UNIX and Microsoft Windows variants.
<br />

<br />
<h5>1. Getting started</h5>
<p>
GDB is installed in almost every current popular Unix system. To run GDB on Unix environment, simply type 'gdb' in the terminal. By doing that we have started a gdb session, where we can control how a program runs and debug it. To quit gdb environment, just type 'quit' or 'q' to go back to Unix terminal.
<br />
Another requirement for your program to be able to debug is that you need to generate debugging information when you compile it. In gcc/g++, simply add '-g' argument when you compile your program.
</p>
<h5>2. Basic commands</h5>
<ul>
<li>'run': run the program until it exits or gets an error</li>
<li>'start': start debugging process. this command is equal to setting a breakpoint after main function and then 'run'.</li>
<li>'n' or 'next': advance execution to the next line of the current function</li>
<li>'s' or 'step': advance execution to the next step of the current program, that means it may lead to a sub-function of the current function, in contrast with 'next' which may not.</li>
<li>'break <i>location</i>': set a breakpoint at the location. location can be a line number, a function name. the program will pause right before the location is executed.</li>
<li>'clear': delete any breakpoints</li>
<li>'clear <i>location</i>': clear the breakpoint at the location.</li>
<li>'p variable': display the value that variable stores. variable must be visible when the command is run, and in the form: 'filename::variable' or 'function::variable'</li>
</ul>

<h5>3. Advanced commands</h5>
<p>
Try this: <a href="http://sourceware.org/gdb/current/onlinedocs/gdb/">GDB Documentation</a>
</p>
